home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / N-P / Progress CDEF Folder / Progress CDEF READ ME next >
Encoding:
Text File  |  1992-11-11  |  1.5 KB  |  38 lines  |  [TEXT/ttxt]

  1. Progress CDEF v0.2
  2. By: Colen Garoutte-Carson
  3.  
  4. This is a simple CDEF which will generate a simple progress box.  It's very useful as a visual representation of the progress of an operation.  (i.e. A file transfer, a file copy, etc)
  5.  
  6. The progress box has a one pixel outline, and is filled from left to right.
  7.  
  8. A progress control can be any size, but unless it's more than 2 pixels by 2 pixels, it won't help you much.
  9.  
  10. The control displays progress in relation to the contrlMax and contrlValue fields of the ControlRecord which are changable with the SetCtlValue and SetCtlMax routines.
  11.  
  12. The contrlMin field is used to specify the color the progress part of the progress control is displayed in.  This field needs to be set to an old-style Quickdraw color constant.
  13.  
  14. The contrlValue and contrlMax fields of the ControlRecord are short words (integers).  You may need long words (longints).  In which case, the RefCon of the control will be set automatically by the CDEF to the following handle:
  15.  
  16.  ProgressHand = ^ProgressPtr;
  17.  ProgressPtr = ^ProgressRec;
  18.  ProgressRec = record
  19.    SoFar: longint;
  20.    Total: longint;
  21.   end;
  22.  
  23. This handle will be automatically disposed of when the control is disposed.
  24.  
  25. Access these variables like so:
  26.  
  27. ProgressHand(MyControl^^.contrlRfCon)^^.SoFar := x;
  28.  
  29. -----
  30.  
  31. This CDEF pretty basic, but since I put the time in to it I'd distribute it around so some other people won't have to.
  32.  
  33. If you like this CDEF, you can send me $5.  (Or more, if you like...)
  34.  
  35. Colen Garoutte-Carson
  36. 1113-A West 6th Ave.
  37. Eugene, OR 97402
  38.